package com.itheima.stock.config;

import com.itheima.stock.cache.Cache;
import com.itheima.stock.cache.impl.RedisCache;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * @author zxh
 * @created 2024/11/1 15:02
 * @description
 */
@Configuration
public class RedisConfiguration {
    @Bean
    public Cache cache(StringRedisTemplate redis)
    {
        return new RedisCache(redis);
    }
}
